package domain

type PackageInfo struct {
	Project  *ProjectInfo `json:"-"`
	Parent   *PackageInfo `json:"-"`
	Name     string
	LocalDir string
	Packages []*PackageInfo
	Files    []*CodeFileInfo
}

func NewPackageInfo() *PackageInfo {
	it := new(PackageInfo)
	it.Packages = []*PackageInfo{}
	it.Files = []*CodeFileInfo{}
	return it
}

func (me *PackageInfo) AppendPackage(it *PackageInfo) {
	it.Project = me.Project
	it.Parent = me
	me.Packages = append(me.Packages, it)
}

func (me *PackageInfo) AppendFile(it *CodeFileInfo) {
	it.Package = me
	me.Files = append(me.Files, it)
}
